<%@page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@page	import="com.grep.extra.dao.impl.ContentParseDao,com.grep.base.util.UUIDGenerator,com.grep.base.util.PinYin4jUtil,com.grep.extra.dao.impl.ContentParseFieldDao"%>
<%
	//添加指标

	request.setCharacterEncoding("UTF-8");

	ContentParseDao contentParse = new ContentParseDao();
	ContentParseFieldDao contentParseField = new ContentParseFieldDao(); 
	String id = UUIDGenerator.getUUID();
	String taskid = request.getParameter("taskid");
	String fieldname = request.getParameter("fieldname");
	String startfield = request.getParameter("startfield");
	String endfield = request.getParameter("endfield");

	String contentParseID = contentParse.getIdforTaskId(taskid);

	String fileldtablename = PinYin4jUtil.getPinyin(fieldname);

	String insersql = "insert into content_parse_field(id,field_name,start_regex,end_regex,fileld_tablename,content_parse_id) values('"
			+ id + "','" + fieldname + "','"+ startfield + "','"+ endfield + "','"+ fileldtablename+"','"+contentParseID+"')";
	boolean issuccess = contentParseField.AddContentParseField(insersql);
	
	if (issuccess) {
		response.getWriter().println("添加任务指标成功");
	} else {
		response.getWriter().println("添加任务指标失败");
	}
	
%>